#ifndef LIGHTNING_H
#define LIGHTNING_H

#include <stdlib.h>

#include "Curve/hsv.h"
#include "Effects/RGBEffect.h"

class Lightning: public RGBEffect
{

public:
    Lightning();
    ~Lightning();

    //EFFECT_REGISTERER(ClassName(), CAT_RANDOM, [](){return new Lightning;});

    static std::string const ClassName() {return "Lightning";}

    //void DefineExtraOptions(QLayout*) override;
    void StepEffect(ControllerZone* const controller_zone) override;
    //void SetUserColors(std::vector<RGBColor>) override;
    void OnControllerZonesListChanged(ControllerZone* const controller_zone) override;
    //void LoadCustomSettings(json) override;
    //json SaveCustomSettings(json) override;

//private slots:
//    void on_lightning_mode_currentIndexChanged(int);

private:
    //Ui::Lightning *ui;

    hsv_t UserHSV;
    std::map<ControllerZone*, std::vector<hsv_t>> Lightnings;
    RGBColor TriggerLightning(ControllerZone*, int);

    enum lightning_mode_value
    {
        WHOLE_ZONE  = 0,
        PER_LED     = 1
    };

    lightning_mode_value lightning_mode = PER_LED;//WHOLE_ZONE;
};

#endif // LIGHTNING_H
